<?php
/**
* 
*/
class UploadImg_model extends Model
{
	
	function __construct()
	{
		parent::__construct();
	}

	public function save_photo_upload($path)
	{
		require SVROOT . 'Controllers/InformationLocal.php';
		$controler = new InformationLocal();
		$Os = $controler->showInfo('os');
		$browser = $controler->showInfo('browser') . '/' .$controler->showInfo('version');

		if(isset($_POST['album'])) {
			$AlbumsId = trim($_POST['album']);
		}
		$imgName = explode('_', $_SESSION['img_name']);
		$data = array(
			'AlbumsId' 		=> trim($_POST['album']),
			'Name'	   		=> $_SESSION['img_name'],
			'Path'			=> $path,
			'UserId'		=> $imgName[0],
			'TimeUpload'	=> $imgName[1],
			'Longitude'		=> $imgName[4],
			'Latitude'		=> $imgName[3],
			'BrowerCreate'	=> $browser,
			'Os'			=> $Os,
			'Detail'		=> trim($_POST['Detail']),
			'Role'			=> trim($_POST['role'])
		);
		$this->db->insert('photos',$data);
	}
}
?>